import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 轮播图信息
 */
@Entity('banner_info')
export class BannerInfoEntity extends BaseEntity {
  @Index()
  @Column({ comment: '标题' })
  title: string;

  @Column({ comment: '图片', nullable: true })
  pic: string;

  @Column({ comment: '跳转链接', nullable: true })
  url: string;

  @Column({ comment: '排序值', default: 0 })
  orderValue: number;

  @Column({ comment: '状态', dict: ['禁用', '启用'], default: 1 })
  status: number;

  @Index()
  @Column({ comment: '分类ID' })
  categoryId: number;
}
